package history.hot100.simple;

import history.hot100.TreeNode;

// 226. 翻转二叉树:https://leetcode-cn.com/problems/invert-binary-tree/
//
public class LeetCode_226 {
    public TreeNode invertTree(TreeNode root) {
        if (root == null) return root;
        TreeNode tempNode = root.left;
        root.left = root.right;
        root.right = tempNode;
        invertTree(root.left);
        invertTree(root.right);
        return root;
    }
}
